#encoding=utf-8
import re
import sys
#这是预处理数据，让他们转换成列表来处理
def preprocess( InFile, OutFile ):
	infile = open( InFile )
	outfile = open( OutFile, 'w' )
	for line in ( line.split("::") for line in infile.readlines() ):
			try:
				userid = line[0]
				movieid = line[1]
				score = line[4]
				outfile.write ( userid + '  ')
				outfile.write ( movieid + '  ')
				outfile.write ( score )
			except:
				continue
				
	infile.close()
	outfile.close()

	 	
if __name__=="__main__":
	preprocess(sys.argv[1],sys.argv[2])
